//
//  ButtonViewController.swift
//  CHSimpleUI
//
//  Created by cyptt on 2022/7/15.
//

import UIKit

class ButtonViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        self.view.backgroundColor = UIColor.white

       
        let btn:UIButton = UIButton.init(type: .custom)
        btn.frame = CGRect.init(x: 20, y: 100, width: 140, height: 40)
        btn.setImage(UIImage.init(named: "juanxin_icon"), for: .normal)
        btn.setTitle("这是一个按", for: .normal)
    
        btn.imageLocal(local: .left, margin: 10)
        btn.backgroundColor = UIColor.gray
        self.view.addSubview(btn)
        
        
     
        let btn2:UIButton = UIButton.init(type: .custom)
        btn2.frame = CGRect.init(x: 20, y: 200, width: 140, height: 40)
        btn2.setImage(UIImage.init(named: "juanxin_icon"), for: .normal)
        btn2.setTitle("这是二个按", for: .normal)
        btn2.imageLocal(local: .right, margin: 10)
        btn2.backgroundColor = UIColor.gray
        self.view.addSubview(btn2)
        
        
        let btn3:UIButton = UIButton.init(type: .custom)
        btn3.frame = CGRect.init(x: 20, y: 300, width: 140, height: 80)
        btn3.setImage(UIImage.init(named: "juanxin_icon"), for: .normal)
        btn3.setTitle("**", for: .normal)
        btn3.backgroundColor = UIColor.gray
        btn3.imageLocal(local: .top, margin: 30)
        self.view.addSubview(btn3)
        
        
        let btn3_1:UIButton = UIButton.init(type: .custom)
        btn3_1.frame = CGRect.init(x: 20, y: 400, width: 140, height: 80)
        btn3_1.setImage(UIImage.init(named: "juanxin_icon"), for: .normal)
        btn3_1.setTitle("******88******", for: .normal)
        btn3_1.backgroundColor = UIColor.gray
        btn3_1.imageLocal(local: .top, margin: 0)
        self.view.addSubview(btn3_1)
        
        
        let btn4:UIButton = UIButton.init(type: .custom)
        btn4.frame = CGRect.init(x: 20, y: 500, width: 140, height: 80)
        btn4.setImage(UIImage.init(named: "juanxin_icon"), for: .normal)
        btn4.setTitle("8888", for: .normal)
        
        btn4.imageLocal(local: .bottom, margin: 10)
        btn4.backgroundColor = UIColor.gray
        self.view.addSubview(btn4)
        
     
        
        let btn6:UIButton = UIButton.init(type: .custom)
        btn6.frame = CGRect.init(x: 20, y: 600, width: 140, height: 80)
        btn6.setImage(UIImage.init(named: "juanxin_icon"), for: .normal)
        btn6.setTitle("六个", for: .normal)
        

        btn6.backgroundColor = UIColor.gray
        self.view.addSubview(btn6)
        
    }
    

   
    

}
